<?php
require_once( './path.php' );
require_once( CLASSMATE_ROOT.'/include/class/app.class.php' );

//初始化页面
app::init();
app::load_mod('mongo_connect');

//@todo 要改
if ( !session::get( 'is_online' ) ){
//登录用户才可使用本页面
	 $response_message = array(
			 'type' => 'info' , 
			 'content' => '您还没有登录系统' ,
			 'url_des'=>'马上去登录？' ,
			 'url' => '/classmate/controller/account/login.php' );
			 
	 session::set( 'response_message' , $response_message );

	 header( 'Location: ../response_message.php' );
	 exit();
}

//从数据库中取出用户的相关信息
$db_connect = mongo_connect();

$db_obj_user_profile = new db_obj_user_profile( $db_connect );
$db_obj_user = new db_obj_user( $db_connect );

$email = session::get( 'email' );

$db_obj_user->load( 'email' , $email );
$db_obj_user_profile->load( 'email' , $email );

//包含了用户的全部信息（页面显示所需要的）
$user_info = array(
		'nick' => $db_obj_user->get( 'nick' ) ,
		'reg_time' => $db_obj_user_profile->get( 'reg_time' ) ,
		'head_url' => $db_obj_user_profile->get( 'head_url' )
);

$tpl = new custom_smarty();

$tpl->assign( 'user_info' , $user_info );

/**
 * 显示牢骚的摘要信息
 *
 */
$user_complaint_process = 


$tpl->assign( 'title' , '同学，这是你的主页' );
$tpl->assign( 'active' , 'home' );

$tpl->display( 'user_home/user_home.tpl' );

